<%= header %>
<%= boomerangScript %>
<script src="35-hold-after-onload.js" type="text/javascript"></script>
<script>
BOOMR_test.init({
	testAfterOnBeacon: 2,
	instrument_xhr: true
});

var isComplete = false;
BOOMR.plugins.HoldPlugin = {
	is_complete: function() {
		return isComplete;
	}
};

// open an XHR after onload
window.onload = function() {
	setTimeout(function() {
		var xhr = new XMLHttpRequest();
		xhr.open("GET", "/assets/img.jpg");
		xhr.send(null);

		xhr.addEventListener("load", function() {
			// wait 100ms to send the beacon
			setTimeout(function() {
				isComplete = true;
				BOOMR.sendBeacon();
			}, 100);
		});
	}, 10);
};
</script>
<%= footer %>
